/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package samoloty.view;

import Utils.MyOwnFocusTraversalPolicy;
import Utils.TextFieldFilter;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.FocusListener;
import java.text.DecimalFormat;
import java.util.Vector;

/**
 *
 * @author frankowp
 */
public class HoldsSubPanel extends ContentPanel {

    private MyLabel holdNoLab;
    private MyLabel hold1Lab;
    private MyLabel hold2Lab;
    private MyLabel hold3Lab;
    private MyLabel hold4Lab;
    private MyLabel hold5Lab;
    //
    private MyLabel hold5lLab;
    private MyLabel hold5rLab;
    private MyLabel hold6Lab;
    //
    private MyLabel totalLab;
    private MyLabel baggageLab;
    private MyTextField b1Text;
    private MyTextField b2Text;
    private MyTextField b3Text;
    private MyTextField b4Text;
    private MyTextField b5Text;
    //
    private MyTextField b5lText;
    private MyTextField b5rText;
    private MyTextField b6Text;
    //
    private MyLabel ttlBLabel;
    private MyLabel cargoLab;
    private MyTextField c1Text;
    private MyTextField c2Text;
    private MyTextField c3Text;
    private MyTextField c4Text;
    private MyTextField c5Text;
    //
    private MyTextField c5lText;
    private MyTextField c5rText;
    private MyTextField c6Text;
    //
    private MyLabel ttlCLabel;
    private MyLabel mailLab;
    private MyTextField m1Text;
    private MyTextField m2Text;
    private MyTextField m3Text;
    private MyTextField m4Text;
    private MyTextField m5Text;
    //
    private MyTextField m5lText;
    private MyTextField m5rText;
    private MyTextField m6Text;
    //
    private MyLabel ttlMLabel;
    private MyLabel ttlLab;
    private MyLabel ttl1Lab;
    private MyLabel ttl2Lab;
    private MyLabel ttl3Lab;
    private MyLabel ttl4Lab;
    private MyLabel ttl5Lab;
    //
    private MyLabel ttl5lLab;
    private MyLabel ttl5rLab;
    private MyLabel ttl6Lab;
    //
    private MyLabel maxLab;
    private MyLabel max1Lab;
    private MyLabel max2Lab;
    private MyLabel max3Lab;
    private MyLabel max4Lab;
    private MyLabel max5Lab;
    //
    private MyLabel max5lLab;
    private MyLabel max5rLab;
    private MyLabel max6Lab;
    //
    private MyLabel maximumLoadExceedLab;
    private MyLabel totalDeadLab;
    private MyLabel totalDeadText;
    private Component takeOffFuelText;
    private MyOwnFocusTraversalPolicy travelsalPolicy;

    public HoldsSubPanel() {
        super();
        initPanel();
    }

    private void initPanel() {
        holdNoLab = new MyLabel("HOLD NO.", MyLabel.BOLD);
        hold1Lab = new MyLabel("1", MyLabel.BOLD);
        hold2Lab = new MyLabel("2", MyLabel.BOLD);
        hold3Lab = new MyLabel("3", MyLabel.BOLD);
        hold4Lab = new MyLabel("4", MyLabel.BOLD);
        hold5Lab = new MyLabel("5", MyLabel.BOLD);
        hold5lLab = new MyLabel("5L", MyLabel.BOLD);
        hold5rLab = new MyLabel("5R", MyLabel.BOLD);
        hold6Lab = new MyLabel("6", MyLabel.BOLD);
        totalLab = new MyLabel("TOTAL", MyLabel.BOLD);

        baggageLab = new MyLabel("BAGGAGE", MyLabel.BOLD);
        b1Text = new MyTextField(4);
        b1Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        b2Text = new MyTextField(4);
        b2Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        b3Text = new MyTextField(4);
        b3Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        b4Text = new MyTextField(4);
        b4Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        b5Text = new MyTextField(4);
        b5Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        b5rText = new MyTextField(4);
        b5rText.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        b5lText = new MyTextField(4);
        b5lText.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        b6Text = new MyTextField(4);
        b6Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        ttlBLabel = new MyLabel("0          ", MyLabel.BOLD);


        cargoLab = new MyLabel("CARGO", MyLabel.BOLD);
        c1Text = new MyTextField(4);
        c1Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        c2Text = new MyTextField(4);
        c2Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        c3Text = new MyTextField(4);
        c3Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        c4Text = new MyTextField(4);
        c4Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        c5Text = new MyTextField(4);
        c5Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        c5rText = new MyTextField(4);
        c5rText.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        c5lText = new MyTextField(4);
        c5lText.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        c6Text = new MyTextField(4);
        c6Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        ttlCLabel = new MyLabel("0      ", MyLabel.BOLD);
        ttlCLabel.setHorizontalTextPosition(MyLabel.CENTER);

        mailLab = new MyLabel("MAIL", MyLabel.BOLD);
        m1Text = new MyTextField(4);
        m1Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        m2Text = new MyTextField(4);
        m2Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        m3Text = new MyTextField(4);
        m3Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        m4Text = new MyTextField(4);
        m4Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        m5Text = new MyTextField(4);
        m5Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        m5rText = new MyTextField(4);
        m5rText.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        m5lText = new MyTextField(4);
        m5lText.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        m6Text = new MyTextField(4);
        m6Text.setFieldFilter(new TextFieldFilter(TextFieldFilter.NUMERIC, 4, false));
        ttlMLabel = new MyLabel("0       ", MyLabel.BOLD);

        ttlLab = new MyLabel("TOTAL", MyLabel.BOLD);
        ttl1Lab = new MyLabel("0       ", MyLabel.BOLD);
        ttl2Lab = new MyLabel("0       ", MyLabel.BOLD);
        ttl3Lab = new MyLabel("0        ", MyLabel.BOLD);
        ttl4Lab = new MyLabel("0       ", MyLabel.BOLD);
        ttl5Lab = new MyLabel("0       ", MyLabel.BOLD);
        ttl5lLab = new MyLabel("0       ", MyLabel.BOLD);
        ttl5rLab = new MyLabel("0       ", MyLabel.BOLD);
        ttl6Lab = new MyLabel("0       ", MyLabel.BOLD);
        ttl1Lab.setHorizontalTextPosition(MyLabel.CENTER);
        maxLab = new MyLabel("MAX.", MyLabel.BOLD);
        max1Lab = new MyLabel("0       ", MyLabel.BOLD);
        max2Lab = new MyLabel("0       ", MyLabel.BOLD);
        max3Lab = new MyLabel("0       ", MyLabel.BOLD);
        max4Lab = new MyLabel("0       ", MyLabel.BOLD);
        max5Lab = new MyLabel("0       ", MyLabel.BOLD);
        max5rLab = new MyLabel("0       ", MyLabel.BOLD);
        max5lLab = new MyLabel("0       ", MyLabel.BOLD);
        max6Lab = new MyLabel("0       ", MyLabel.BOLD);
        maximumLoadExceedLab = new MyLabel("MAXIMUM LOAD EXCEEDED", MyLabel.BOLD);
        totalDeadLab = new MyLabel("TOTAL DEADLOAD", MyLabel.BOLD);
        totalDeadText = new MyLabel("9999999", MyLabel.BOLD);

        setLayout(null);
        add(holdNoLab);
        add(hold1Lab);
        add(hold2Lab);
        add(hold3Lab);
        add(hold4Lab);
        add(hold5Lab);
        add(hold5lLab);
        add(hold5rLab);
        add(hold6Lab);
        add(totalLab);

        add(baggageLab);
        add(b1Text);
        add(b2Text);
        add(b3Text);
        add(b4Text);
        add(b5Text);
        add(b5lText);
        add(b5rText);
        add(b6Text);
        add(ttlBLabel);

        add(cargoLab);
        add(c1Text);
        add(c2Text);
        add(c3Text);
        add(c4Text);
        add(c5Text);
        add(c5lText);
        add(c5rText);
        add(c6Text);
        add(ttlCLabel);

        add(mailLab);
        add(m1Text);
        add(m2Text);
        add(m3Text);
        add(m4Text);
        add(m5Text);
        add(m5lText);
        add(m5rText);
        add(m6Text);
        add(ttlMLabel);

        add(ttlLab);
        add(ttl1Lab);
        add(ttl2Lab);
        add(ttl3Lab);
        add(ttl4Lab);
        add(ttl5Lab);
        add(ttl5lLab);
        add(ttl5rLab);
        add(ttl6Lab);
        add(maxLab);
        add(max1Lab);
        add(max2Lab);
        add(max3Lab);
        add(max4Lab);
        add(max5Lab);
        add(max5lLab);
        add(max5rLab);
        add(max6Lab);

        add(maximumLoadExceedLab);
        add(totalDeadLab);
        add(totalDeadText);

        int textWidth = 46;
        int tW = b1Text.getPreferredSize().width - 28;

        holdNoLab.setPositionByRight(new Point(100, 10));
        hold1Lab.setPositionByRight(new Point(140, 10));
        hold2Lab.setPositionByRight(new Point(190, 10));
        hold3Lab.setPositionByRight(new Point(240, 10));
        hold4Lab.setPositionByRight(new Point(290, 10));
        hold5Lab.setPositionByRight(new Point(340, 10));
        hold5lLab.setPositionByRight(new Point(390, 10));
        hold5rLab.setPositionByRight(new Point(440, 10));
        hold6Lab.setPositionByRight(new Point(480, 10));
        totalLab.setPositionByRight(new Point(560, 10));

        baggageLab.setPositionByRight(new Point(100, 40));
        b1Text.setPosition(new Point(110, 40));
        b2Text.setPosition(new Point(127 + tW, 40));
        b3Text.setPosition(new Point(144 + 2 * tW, 40));
        b4Text.setPosition(new Point(161 + 3 * tW, 40));
        b5Text.setPosition(new Point(178 + 4 * tW, 40));
        b5lText.setPosition(new Point(195 + 5 * tW, 40));
        b5rText.setPosition(new Point(212 + 6 * tW, 40));
        b6Text.setPosition(new Point(229 + 7 * tW, 40));
        ttlBLabel.setPosition(new Point(525, 40));
        ttlBLabel.setPreferredSize(new Dimension(ttlMLabel.getPreferredSize().width + 20, ttlMLabel.getPreferredSize().height));


        cargoLab.setPositionByRight(new Point(100, 70));
        c1Text.setPosition(new Point(110, 70));
        c2Text.setPosition(new Point(127 + tW, 70));
        c3Text.setPosition(new Point(144 + 2 * tW, 70));
        c4Text.setPosition(new Point(161 + 3 * tW, 70));
        c5Text.setPosition(new Point(178 + 4 * tW, 70));
        c5lText.setPosition(new Point(195 + 5 * tW, 70));
        c5rText.setPosition(new Point(212 + 6 * tW, 70));
        c6Text.setPosition(new Point(229 + 7 * tW, 70));
        ttlCLabel.setPosition(new Point(525, 70));
        ttlCLabel.setPreferredSize(new Dimension(ttlMLabel.getPreferredSize().width + 20, ttlMLabel.getPreferredSize().height));


        mailLab.setPositionByRight(new Point(100, 100));
        m1Text.setPosition(new Point(110, 100));
        m2Text.setPosition(new Point(127 + tW, 100));
        m3Text.setPosition(new Point(144 + 2 * tW, 100));
        m4Text.setPosition(new Point(161 + 3 * tW, 100));
        m5Text.setPosition(new Point(178 + 4 * tW, 100));
        m5lText.setPosition(new Point(195 + 5 * tW, 100));
        m5rText.setPosition(new Point(212 + 6 * tW, 100));
        m6Text.setPosition(new Point(229 + 7 * tW, 100));
        ttlMLabel.setPosition(new Point(525, 100));
        ttlMLabel.setPreferredSize(new Dimension(ttlMLabel.getPreferredSize().width + 20, ttlMLabel.getPreferredSize().height));

        ttlLab.setPositionByRight(new Point(100, 130));
        ttl1Lab.setPosition(new Point(110, 130));
        //ttl1Lab.setPreferredSize(new Dimension(ttl1Lab.getPreferredSize().width+5, ttl1Lab.getPreferredSize().height));
        ttl2Lab.setPosition(new Point(110 + tW, 130));
        ttl3Lab.setPosition(new Point(130 + 2 * tW, 130));
        ttl4Lab.setPosition(new Point(145 + 3 * tW, 130));
        ttl5Lab.setPosition(new Point(150 + 4 * tW, 130));
        ttl5lLab.setPosition(new Point(165 + 5 * tW, 130));
        ttl5rLab.setPosition(new Point(210 + 6 * tW, 130));
        ttl6Lab.setPosition(new Point(220 + 7 * tW, 130));

        maxLab.setPositionByRight(new Point(100, 160));
        max1Lab.setPosition(new Point(115, 160));
        max2Lab.setPosition(new Point(120 + tW, 160));
        max3Lab.setPosition(new Point(140 + 2 * tW, 160));
        max4Lab.setPosition(new Point(155 + 3 * tW, 160));
        max5Lab.setPosition(new Point(170 + 4 * tW, 160));
        max5lLab.setPosition(new Point(190 + 5 * tW, 160));
        max5rLab.setPosition(new Point(210 + 6 * tW, 160));
        max6Lab.setPosition(new Point(225 + 7 * tW, 160));

        totalDeadLab.setPositionByRight(new Point(320, 210));
        totalDeadText.setPosition(new Point(325, 210));

        maximumLoadExceedLab.setPosition(new Point(170, 185));
        maximumLoadExceedLab.setForeground(Color.red);
        maximumLoadExceedLab.setVisible(false);

        b1Text.setSize(textWidth, b1Text.getHeight());
        b2Text.setSize(textWidth, b1Text.getHeight());
        b3Text.setSize(textWidth, b1Text.getHeight());
        b4Text.setSize(textWidth, b1Text.getHeight());
        b5Text.setSize(textWidth, b1Text.getHeight());
        b5lText.setSize(textWidth, b1Text.getHeight());
        b5rText.setSize(textWidth, b1Text.getHeight());
        b6Text.setSize(textWidth, b1Text.getHeight());
        c1Text.setSize(textWidth, c1Text.getHeight());
        c2Text.setSize(textWidth, c1Text.getHeight());
        c3Text.setSize(textWidth, c1Text.getHeight());
        c4Text.setSize(textWidth, c1Text.getHeight());
        c5Text.setSize(textWidth, c1Text.getHeight());
        c5lText.setSize(textWidth, b1Text.getHeight());
        c5rText.setSize(textWidth, b1Text.getHeight());
        c6Text.setSize(textWidth, b1Text.getHeight());
        m1Text.setSize(textWidth, c1Text.getHeight());
        m2Text.setSize(textWidth, c1Text.getHeight());
        m3Text.setSize(textWidth, c1Text.getHeight());
        m4Text.setSize(textWidth, c1Text.getHeight());
        m5Text.setSize(textWidth, c1Text.getHeight());
        m5lText.setSize(textWidth, b1Text.getHeight());
        m5rText.setSize(textWidth, b1Text.getHeight());
        m6Text.setSize(textWidth, b1Text.getHeight());
        ttl1Lab.setSize(new Dimension(ttl1Lab.getSize().width + 30, ttl1Lab.getSize().height));
        ttl2Lab.setSize(new Dimension(ttl1Lab.getSize().width + 30, ttl1Lab.getSize().height));
        ttl3Lab.setSize(new Dimension(ttl1Lab.getSize().width + 30, ttl1Lab.getSize().height));
        ttl4Lab.setSize(new Dimension(ttl1Lab.getSize().width + 30, ttl1Lab.getSize().height));
        ttl5Lab.setSize(new Dimension(ttl1Lab.getSize().width + 20, ttl1Lab.getSize().height));
        ttl5lLab.setSize(new Dimension(ttl1Lab.getSize().width + 20, ttl1Lab.getSize().height));
        ttl5rLab.setSize(new Dimension(ttl1Lab.getSize().width + 20, ttl1Lab.getSize().height));
        ttl6Lab.setSize(new Dimension(ttl1Lab.getSize().width + 20, ttl1Lab.getSize().height));

        max1Lab.setSize(new Dimension(max1Lab.getSize().width + 30, max1Lab.getSize().height));
        max2Lab.setSize(new Dimension(max1Lab.getSize().width + 30, max1Lab.getSize().height));
        max3Lab.setSize(new Dimension(max1Lab.getSize().width + 30, max1Lab.getSize().height));
        max4Lab.setSize(new Dimension(max1Lab.getSize().width + 30, max1Lab.getSize().height));
        max5Lab.setSize(new Dimension(max1Lab.getSize().width + 20, max1Lab.getSize().height));
        max5lLab.setSize(new Dimension(max1Lab.getSize().width + 20, max1Lab.getSize().height));
        max5rLab.setSize(new Dimension(max1Lab.getSize().width + 20, max1Lab.getSize().height));
        max6Lab.setSize(new Dimension(max1Lab.getSize().width + 20, max1Lab.getSize().height));


    }

    void reset() {

        b1Text.setText("0");
        b2Text.setText("0");
        b3Text.setText("0");
        b4Text.setText("0");
        b5Text.setText("0");
        b5lText.setText("0");
        b5rText.setText("0");
        b6Text.setText("0");
        ttlBLabel.setText("0        ");

        c1Text.setText("0");
        c2Text.setText("0");
        c3Text.setText("0");
        c4Text.setText("0");
        c5Text.setText("0");
        c5lText.setText("0");
        c5rText.setText("0");
        c6Text.setText("0");
        ttlCLabel.setText("0        ");

        m1Text.setText("0");
        m2Text.setText("0");
        m3Text.setText("0");
        m4Text.setText("0");
        m5Text.setText("0");
        m5lText.setText("0");
        m5rText.setText("0");
        m6Text.setText("0");
        ttlMLabel.setText("0        ");

        ttl1Lab.setText("0");
        ttl2Lab.setText("0");
        ttl3Lab.setText("0");
        ttl4Lab.setText("0");
        ttl5Lab.setText("0");
        ttl5lLab.setText("0");
        ttl5rLab.setText("0");
        ttl6Lab.setText("0");
        max1Lab.setText("0");
        max2Lab.setText("0");
        max3Lab.setText("0");
        max4Lab.setText("0");
        max5Lab.setText("0");
        max5lLab.setText("0");
        max5rLab.setText("0");
        max6Lab.setText("0");

        int textWidth = 46;
        int tW = b1Text.getPreferredSize().width - 28;

        holdNoLab.setPositionByRight(new Point(100, 10));
        hold1Lab.setPositionByRight(new Point(140, 10));
        hold2Lab.setPositionByRight(new Point(190, 10));
        hold3Lab.setPositionByRight(new Point(240, 10));
        hold4Lab.setPositionByRight(new Point(290, 10));
        hold5Lab.setPositionByRight(new Point(340, 10));
        hold5lLab.setPositionByRight(new Point(390, 10));
        hold5rLab.setPositionByRight(new Point(440, 10));
        hold6Lab.setPositionByRight(new Point(480, 10));
        totalLab.setPositionByRight(new Point(560, 10));

        baggageLab.setPositionByRight(new Point(100, 40));
        b1Text.setPosition(new Point(110, 40));
        b2Text.setPosition(new Point(127 + tW, 40));
        b3Text.setPosition(new Point(144 + 2 * tW, 40));
        b4Text.setPosition(new Point(161 + 3 * tW, 40));
        b5Text.setPosition(new Point(178 + 4 * tW, 40));
        b5lText.setPosition(new Point(195 + 5 * tW, 40));
        b5rText.setPosition(new Point(212 + 6 * tW, 40));
        b6Text.setPosition(new Point(229 + 7 * tW, 40));
        ttlBLabel.setPosition(new Point(525, 40));

        cargoLab.setPositionByRight(new Point(100, 70));
        c1Text.setPosition(new Point(110, 70));
        c2Text.setPosition(new Point(127 + tW, 70));
        c3Text.setPosition(new Point(144 + 2 * tW, 70));
        c4Text.setPosition(new Point(161 + 3 * tW, 70));
        c5Text.setPosition(new Point(178 + 4 * tW, 70));
        c5lText.setPosition(new Point(195 + 5 * tW, 70));
        c5rText.setPosition(new Point(212 + 6 * tW, 70));
        c6Text.setPosition(new Point(229 + 7 * tW, 70));
        ttlCLabel.setPosition(new Point(525, 70));

        mailLab.setPositionByRight(new Point(100, 100));
        m1Text.setPosition(new Point(110, 100));
        m2Text.setPosition(new Point(127 + tW, 100));
        m3Text.setPosition(new Point(144 + 2 * tW, 100));
        m4Text.setPosition(new Point(161 + 3 * tW, 100));
        m5Text.setPosition(new Point(178 + 4 * tW, 100));
        m5lText.setPosition(new Point(195 + 5 * tW, 100));
        m5rText.setPosition(new Point(212 + 6 * tW, 100));
        m6Text.setPosition(new Point(229 + 7 * tW, 100));
        ttlMLabel.setPosition(new Point(525, 100));

        ttlLab.setPositionByRight(new Point(100, 130));
        ttl1Lab.setPosition(new Point(110, 130));
        ttl2Lab.setPosition(new Point(110 + tW, 130));
        ttl3Lab.setPosition(new Point(130 + 2 * tW, 130));
        ttl4Lab.setPosition(new Point(145 + 3 * tW, 130));
        ttl5Lab.setPosition(new Point(150 + 4 * tW, 130));
        ttl5lLab.setPosition(new Point(165 + 5 * tW, 130));
        ttl5rLab.setPosition(new Point(210 + 6 * tW, 130));
        ttl6Lab.setPosition(new Point(220 + 7 * tW, 130));

        maxLab.setPositionByRight(new Point(100, 160));
        max1Lab.setPosition(new Point(115, 160));
        max2Lab.setPosition(new Point(120 + tW, 160));
        max3Lab.setPosition(new Point(140 + 2 * tW, 160));
        max4Lab.setPosition(new Point(155 + 3 * tW, 160));
        max5Lab.setPosition(new Point(170 + 4 * tW, 160));
        max5lLab.setPosition(new Point(190 + 5 * tW, 160));
        max5rLab.setPosition(new Point(210 + 6 * tW, 160));
        max6Lab.setPosition(new Point(225 + 7 * tW, 160));

        b1Text.setSize(textWidth, b1Text.getHeight());
        b2Text.setSize(textWidth, b1Text.getHeight());
        b3Text.setSize(textWidth, b1Text.getHeight());
        b4Text.setSize(textWidth, b1Text.getHeight());
        b5Text.setSize(textWidth, b1Text.getHeight());
        b5lText.setSize(textWidth, b1Text.getHeight());
        b5rText.setSize(textWidth, b1Text.getHeight());
        b6Text.setSize(textWidth, b1Text.getHeight());
        c1Text.setSize(textWidth, c1Text.getHeight());
        c2Text.setSize(textWidth, c1Text.getHeight());
        c3Text.setSize(textWidth, c1Text.getHeight());
        c4Text.setSize(textWidth, c1Text.getHeight());
        c5Text.setSize(textWidth, c1Text.getHeight());
        c5lText.setSize(textWidth, b1Text.getHeight());
        c5rText.setSize(textWidth, b1Text.getHeight());
        c6Text.setSize(textWidth, b1Text.getHeight());
        m1Text.setSize(textWidth, c1Text.getHeight());
        m2Text.setSize(textWidth, c1Text.getHeight());
        m3Text.setSize(textWidth, c1Text.getHeight());
        m4Text.setSize(textWidth, c1Text.getHeight());
        m5Text.setSize(textWidth, c1Text.getHeight());
        m5lText.setSize(textWidth, b1Text.getHeight());
        m5rText.setSize(textWidth, b1Text.getHeight());
        m6Text.setSize(textWidth, b1Text.getHeight());
        ttl1Lab.setSize(new Dimension(ttl1Lab.getSize().width + 30, ttl1Lab.getSize().height));
        ttl2Lab.setSize(new Dimension(ttl1Lab.getSize().width + 30, ttl1Lab.getSize().height));
        ttl3Lab.setSize(new Dimension(ttl1Lab.getSize().width + 30, ttl1Lab.getSize().height));
        ttl4Lab.setSize(new Dimension(ttl1Lab.getSize().width + 30, ttl1Lab.getSize().height));
        ttl5Lab.setSize(new Dimension(ttl1Lab.getSize().width + 20, ttl1Lab.getSize().height));
        ttl5lLab.setSize(new Dimension(ttl1Lab.getSize().width + 20, ttl1Lab.getSize().height));
        ttl5rLab.setSize(new Dimension(ttl1Lab.getSize().width + 20, ttl1Lab.getSize().height));
        ttl6Lab.setSize(new Dimension(ttl1Lab.getSize().width + 20, ttl1Lab.getSize().height));

        max1Lab.setSize(new Dimension(max1Lab.getSize().width + 30, max1Lab.getSize().height));
        max2Lab.setSize(new Dimension(max1Lab.getSize().width + 30, max1Lab.getSize().height));
        max3Lab.setSize(new Dimension(max1Lab.getSize().width + 30, max1Lab.getSize().height));
        max4Lab.setSize(new Dimension(max1Lab.getSize().width + 30, max1Lab.getSize().height));
        max5Lab.setSize(new Dimension(max1Lab.getSize().width + 20, max1Lab.getSize().height));
        max5lLab.setSize(new Dimension(max1Lab.getSize().width + 20, max1Lab.getSize().height));
        max5rLab.setSize(new Dimension(max1Lab.getSize().width + 20, max1Lab.getSize().height));
        max6Lab.setSize(new Dimension(max1Lab.getSize().width + 20, max1Lab.getSize().height));

        maximumLoadExceedLab.setVisible(false);
    }

    public String getb1Text() {
        return b1Text.getText();
    }

    public String getb2Text() {
        return b2Text.getText();
    }

    public String getb3Text() {
        return b3Text.getText();
    }

    public String getb4Text() {
        return b4Text.getText();
    }

    public String getb5Text() {
        return b5Text.getText();
    }

    public String getb5lText() {
        return b5lText.getText();
    }

    public String getb5rText() {
        return b5rText.getText();
    }

    public String getb6Text() {
        return b6Text.getText();
    }

    public String getc1Text() {
        return c1Text.getText();
    }

    public String getc2Text() {
        return c2Text.getText();
    }

    public String getc3Text() {
        return c3Text.getText();
    }

    public String getc4Text() {
        return c4Text.getText();
    }

    public String getc5Text() {
        return c5Text.getText();
    }

    public String getc5lText() {
        return c5lText.getText();
    }

    public String getc5rText() {
        return c5rText.getText();
    }

    public String getc6Text() {
        return c6Text.getText();
    }

    public String getm1Text() {
        return m1Text.getText();
    }

    public String getm2Text() {
        return m2Text.getText();
    }

    public String getm3Text() {
        return m3Text.getText();
    }

    public String getm4Text() {
        return m4Text.getText();
    }

    public String getm5Text() {
        return m5Text.getText();
    }

    public String getm5lText() {
        return m5lText.getText();
    }

    public String getm5rText() {
        return m5rText.getText();
    }

    public String getm6Text() {
        return m6Text.getText();
    }

    public String getmax1Lab() {
        return max1Lab.getText();
    }

    public String getmax2Lab() {
        return max2Lab.getText();
    }

    public String getmax3Lab() {
        return max3Lab.getText();
    }

    public String getmax4Lab() {
        return max4Lab.getText();
    }

    public String getmax5Lab() {
        return max5Lab.getText();
    }

    public String getmax5lLab() {
        return max5lLab.getText();
    }

    public String getmax5rLab() {
        return max5rLab.getText();
    }

    public String getmax6Lab() {
        return max6Lab.getText();
    }

    public void setTtl1Lab(String value) {
        ttl1Lab.setText(value);
    }

    public void setTtl2Lab(String value) {
        ttl2Lab.setText(value);
    }

    public void setTtl3Lab(String value) {
        ttl3Lab.setText(value);
    }

    public void setTtl4Lab(String value) {
        ttl4Lab.setText(value);
    }

    public void setTtl5Lab(String value) {
        ttl5Lab.setText(value);
    }

    public void setTtl5lLab(String value) {
        ttl5lLab.setText(value);
    }

    public void setTtl5rLab(String value) {
        ttl5rLab.setText(value);
    }

    public void setTtl6Lab(String value) {
        ttl6Lab.setText(value);
    }

    public void setMax1Lab(String value) {
        max1Lab.setText(value);
    }

    public void setMax2Lab(String value) {
        max2Lab.setText(value);
    }

    public void setMax3Lab(String value) {
        max3Lab.setText(value);
    }

    public void setMax4Lab(String value) {
        max4Lab.setText(value);
    }

    public void setMax5Lab(String value) {
        max5Lab.setText(value);
    }

    public void setMax5lLab(String value) {
        max5lLab.setText(value);
    }

    public void setMax5rLab(String value) {
        max5rLab.setText(value);
    }

    public void setMax6Lab(String value) {
        max6Lab.setText(value);
    }

    public void setTTLBLab(String value) {
        ttlBLabel.setText(value);
    }

    public void setTTLCLab(String value) {
        ttlCLabel.setText(value);
    }

    public void setTTLMLab(String value) {
        ttlMLabel.setText(value);
    }

    void setB1FocusListener(FocusListener listener) {
        b1Text.addFocusListener(listener);
    }

    void setB2FocusListener(FocusListener listener) {
        b2Text.addFocusListener(listener);
    }

    void setB3FocusListener(FocusListener listener) {
        b3Text.addFocusListener(listener);
    }

    void setB4FocusListener(FocusListener listener) {
        b4Text.addFocusListener(listener);
    }

    void setB5FocusListener(FocusListener listener) {
        b5Text.addFocusListener(listener);
    }

    void setB5lFocusListener(FocusListener listener) {
        b5lText.addFocusListener(listener);
    }

    void setB5rFocusListener(FocusListener listener) {
        b5rText.addFocusListener(listener);
    }

    void setB6FocusListener(FocusListener listener) {
        b6Text.addFocusListener(listener);
    }

    void setC1FocusListener(FocusListener listener) {
        c1Text.addFocusListener(listener);
    }

    void setC2FocusListener(FocusListener listener) {
        c2Text.addFocusListener(listener);
    }

    void setC3FocusListener(FocusListener listener) {
        c3Text.addFocusListener(listener);
    }

    void setC4FocusListener(FocusListener listener) {
        c4Text.addFocusListener(listener);
    }

    void setC5FocusListener(FocusListener listener) {
        c5Text.addFocusListener(listener);
    }

    void setC5lFocusListener(FocusListener listener) {
        c5lText.addFocusListener(listener);
    }

    void setC5rFocusListener(FocusListener listener) {
        c5rText.addFocusListener(listener);
    }

    void setC6FocusListener(FocusListener listener) {
        c6Text.addFocusListener(listener);
    }

    void setM1FocusListener(FocusListener listener) {
        m1Text.addFocusListener(listener);
    }

    void setM2FocusListener(FocusListener listener) {
        m2Text.addFocusListener(listener);
    }

    void setM3FocusListener(FocusListener listener) {
        m3Text.addFocusListener(listener);
    }

    void setM4FocusListener(FocusListener listener) {
        m4Text.addFocusListener(listener);
    }

    void setM5FocusListener(FocusListener listener) {
        m5Text.addFocusListener(listener);
    }

    void setM5lFocusListener(FocusListener listener) {
        m5lText.addFocusListener(listener);
    }

    void setM5rFocusListener(FocusListener listener) {
        m5rText.addFocusListener(listener);
    }

    void setM6FocusListener(FocusListener listener) {
        m6Text.addFocusListener(listener);
    }

    void unhide() {
        this.b1Text.setVisible(true);
        this.c1Text.setVisible(true);
        this.m1Text.setVisible(true);
        this.max1Lab.setVisible(true);
        this.hold1Lab.setVisible(true);
        this.ttl1Lab.setVisible(true);
        this.b2Text.setVisible(true);
        this.c2Text.setVisible(true);
        this.m2Text.setVisible(true);
        this.max2Lab.setVisible(true);
        this.hold2Lab.setVisible(true);
        this.ttl2Lab.setVisible(true);
        this.b3Text.setVisible(true);
        this.c3Text.setVisible(true);
        this.m3Text.setVisible(true);
        this.max3Lab.setVisible(true);
        this.hold3Lab.setVisible(true);
        this.ttl3Lab.setVisible(true);
        this.b4Text.setVisible(true);
        this.c4Text.setVisible(true);
        this.m4Text.setVisible(true);
        this.max4Lab.setVisible(true);
        this.hold4Lab.setVisible(true);
        this.ttl4Lab.setVisible(true);
        this.b5Text.setVisible(true);
        this.c5Text.setVisible(true);
        this.m5Text.setVisible(true);
        this.max5Lab.setVisible(true);
        this.hold5Lab.setVisible(true);
        this.ttl5Lab.setVisible(true);
        this.b5lText.setVisible(true);
        this.c5lText.setVisible(true);
        this.m5lText.setVisible(true);
        this.max5lLab.setVisible(true);
        this.hold5lLab.setVisible(true);
        this.ttl5lLab.setVisible(true);
        this.b5rText.setVisible(true);
        this.c5rText.setVisible(true);
        this.m5rText.setVisible(true);
        this.max5rLab.setVisible(true);
        this.hold5rLab.setVisible(true);
        this.ttl5rLab.setVisible(true);
        this.b6Text.setVisible(true);
        this.c6Text.setVisible(true);
        this.m6Text.setVisible(true);
        this.max6Lab.setVisible(true);
        this.hold6Lab.setVisible(true);
        this.ttl6Lab.setVisible(true);
    }

    void hideField(String name) {
        if (name.equals("1")) {
            this.b1Text.setVisible(false);
            this.c1Text.setVisible(false);
            this.m1Text.setVisible(false);
            this.max1Lab.setVisible(false);
            this.hold1Lab.setVisible(false);
            this.ttl1Lab.setVisible(false);
            shift_fields("6");
            shift_fields("5r");
            shift_fields("5l");
            shift_fields("5");
            shift_fields("4");
            shift_fields("3");
            shift_fields("2");
            shift_fields("1");
        } else if (name.equals("2")) {
            this.b2Text.setVisible(false);
            this.c2Text.setVisible(false);
            this.m2Text.setVisible(false);
            this.max2Lab.setVisible(false);
            this.hold2Lab.setVisible(false);
            this.ttl2Lab.setVisible(false);
            shift_fields("6");
            shift_fields("5r");
            shift_fields("5l");
            shift_fields("5");
            shift_fields("4");
            shift_fields("3");
            shift_fields("2");
        } else if (name.equals("3")) {
            this.b3Text.setVisible(false);
            this.c3Text.setVisible(false);
            this.m3Text.setVisible(false);
            this.max3Lab.setVisible(false);
            this.hold3Lab.setVisible(false);
            this.ttl3Lab.setVisible(false);
            shift_fields("6");
            shift_fields("5r");
            shift_fields("5l");
            shift_fields("5");
            shift_fields("4");
            shift_fields("3");
        } else if (name.equals("4")) {
            this.b4Text.setVisible(false);
            this.c4Text.setVisible(false);
            this.m4Text.setVisible(false);
            this.max4Lab.setVisible(false);
            this.hold4Lab.setVisible(false);
            this.ttl4Lab.setVisible(false);
            shift_fields("6");
            shift_fields("5r");
            shift_fields("5l");
            shift_fields("5");
            shift_fields("4");
        } else if (name.equals("5")) {
            this.b5Text.setVisible(false);
            this.c5Text.setVisible(false);
            this.m5Text.setVisible(false);
            this.max5Lab.setVisible(false);
            this.hold5Lab.setVisible(false);
            this.ttl5Lab.setVisible(false);
            shift_fields("6");
            shift_fields("5r");
            shift_fields("5l");
            shift_fields("5");
        } else if (name.equals("5l") || name.equals("5L")) {
            this.b5lText.setVisible(false);
            this.c5lText.setVisible(false);
            this.m5lText.setVisible(false);
            this.max5lLab.setVisible(false);
            this.hold5lLab.setVisible(false);
            this.ttl5lLab.setVisible(false);
            shift_fields("6");
            shift_fields("5r");
            shift_fields("5l");
        } else if (name.equals("5r") || name.equals("5R")) {
            this.b5rText.setVisible(false);
            this.c5rText.setVisible(false);
            this.m5rText.setVisible(false);
            this.max5rLab.setVisible(false);
            this.hold5rLab.setVisible(false);
            this.ttl5rLab.setVisible(false);
            shift_fields("6");
            shift_fields("5r");
        } else if (name.equals("6")) {
            this.b6Text.setVisible(false);
            this.c6Text.setVisible(false);
            this.m6Text.setVisible(false);
            this.max6Lab.setVisible(false);
            this.hold6Lab.setVisible(false);
            this.ttl6Lab.setVisible(false);
            shift_fields("6");
        }

        this.hold5lLab.moveLeft(5);
        this.ttl5lLab.moveRight(5);
        this.max5lLab.moveLeft(5);
        this.hold1Lab.moveLeft(1);
        this.hold2Lab.moveLeft(1);
        this.hold3Lab.moveLeft(1);
        this.hold4Lab.moveLeft(1);
        this.ttl2Lab.moveRight(1);
        this.ttl3Lab.moveRight(1);
        this.ttl4Lab.moveRight(1);
        this.ttl5Lab.moveLeft(1);
        this.ttl5lLab.moveLeft(19);
        this.ttl5rLab.moveRight(22);


        this.max1Lab.moveLeft(1);
        this.max2Lab.moveLeft(1);
        this.max3Lab.moveLeft(1);
        this.max4Lab.moveLeft(1);

        setOrderList();
    }

    public void shift_fields(String exclude) {
        if (exclude.equals("1")) {
            this.b2Text.setLocation(b1Text.getLocation());
            this.c2Text.setLocation(c1Text.getLocation());
            this.m2Text.setLocation(m1Text.getLocation());
            this.max2Lab.setLocation(max1Lab.getLocation());
            this.hold2Lab.setLocation(hold1Lab.getLocation());
            this.ttl2Lab.setLocation(ttl1Lab.getLocation());
        } else if (exclude.equals("2")) {
            this.b3Text.setLocation(b2Text.getLocation());
            this.c3Text.setLocation(c2Text.getLocation());
            this.m3Text.setLocation(m2Text.getLocation());
            this.max3Lab.setLocation(max2Lab.getLocation());
            this.hold3Lab.setLocation(hold2Lab.getLocation());
            this.ttl3Lab.setLocation(ttl2Lab.getLocation());
        } else if (exclude.equals("3")) {
            this.b4Text.setLocation(b3Text.getLocation());
            this.c4Text.setLocation(c3Text.getLocation());
            this.m4Text.setLocation(m3Text.getLocation());
            this.max4Lab.setLocation(max3Lab.getLocation());
            this.hold4Lab.setLocation(hold3Lab.getLocation());
            this.ttl4Lab.setLocation(ttl3Lab.getLocation());
        } else if (exclude.equals("4")) {
            this.b5Text.setLocation(b4Text.getLocation());
            this.c5Text.setLocation(c4Text.getLocation());
            this.m5Text.setLocation(m4Text.getLocation());
            this.max5Lab.setLocation(max4Lab.getLocation());
            this.hold5Lab.setLocation(hold4Lab.getLocation());
            this.ttl5Lab.setLocation(ttl4Lab.getLocation());
        } else if (exclude.equals("5")) {
            this.b5lText.setLocation(b5Text.getLocation());
            this.c5lText.setLocation(c5Text.getLocation());
            this.m5lText.setLocation(m5Text.getLocation());
            this.max5lLab.setLocation(max5Lab.getLocation());
            this.hold5lLab.setLocation(hold5Lab.getLocation());
            this.ttl5lLab.setLocation(ttl5Lab.getLocation());
        } else if (exclude.equals("5l")) {
            this.b5rText.setLocation(b5lText.getLocation());
            this.c5rText.setLocation(c5lText.getLocation());
            this.m5rText.setLocation(m5lText.getLocation());
            this.max5rLab.setLocation(max5lLab.getLocation());
            this.hold5rLab.setLocation(hold5lLab.getLocation());
            this.ttl5rLab.setLocation(ttl5lLab.getLocation());
        } else if (exclude.equals("5r")) {
            this.b6Text.setLocation(b5rText.getLocation());
            this.c6Text.setLocation(c5rText.getLocation());
            this.m6Text.setLocation(m5rText.getLocation());
            this.max6Lab.setLocation(max5rLab.getLocation());
            this.hold6Lab.setLocation(hold5rLab.getLocation());
            this.ttl6Lab.setLocation(ttl5rLab.getLocation());
        } else if (exclude.equals("6")) {
            this.totalLab.setLocation(hold6Lab.getLocation());
            this.ttlBLabel.setLocation(new Point(b6Text.getLocation().x + 25, b6Text.getLocation().y));
            this.ttlCLabel.setLocation(new Point(c6Text.getLocation().x + 25, c6Text.getLocation().y));
            this.ttlMLabel.setLocation(new Point(m6Text.getLocation().x + 25, m6Text.getLocation().y));
        }
        this.repaint();
    }

    //Gettery do ekranu preview
    public String get_vhold1b() {
        return b1Text.getText();
    }

    public String get_vhold1c() {
        return c1Text.getText();
    }

    public String get_vhold1m() {
        return m1Text.getText();
    }

    public String get_vhold2b() {
        return b2Text.getText();
    }

    public String get_vhold2c() {
        return c2Text.getText();
    }

    public String get_vhold2m() {
        return m2Text.getText();
    }

    public String get_vhold3b() {
        return b3Text.getText();
    }

    public String get_vhold3c() {
        return c3Text.getText();
    }

    public String get_vhold3m() {
        return m3Text.getText();
    }

    public String get_vhold4b() {
        return b4Text.getText();
    }

    public String get_vhold4c() {
        return c4Text.getText();
    }

    public String get_vhold4m() {
        return m4Text.getText();
    }

    public String get_vhold5b() {
        return b5Text.getText();
    }

    public String get_vhold5c() {
        return c5Text.getText();
    }

    public String get_vhold5m() {
        return m5Text.getText();
    }

    public String get_vhold5lb() {
        return b5lText.getText();
    }

    public String get_vhold5lc() {
        return c5lText.getText();
    }

    public String get_vhold5lm() {
        return m5lText.getText();
    }

    public String get_vhold5rb() {
        return b5rText.getText();
    }

    public String get_vhold5rc() {
        return c5rText.getText();
    }

    public String get_vhold5rm() {
        return m5rText.getText();
    }

    public String get_vhold6b() {
        return b6Text.getText();
    }

    public String get_vhold6c() {
        return c6Text.getText();
    }

    public String get_vhold6m() {
        return m6Text.getText();
    }

    public String get_vttlhold1() {
        return ttl1Lab.getText();
    }

    public String get_vttlhold2() {
        return ttl2Lab.getText();
    }

    public String get_vttlhold3() {
        return ttl3Lab.getText();
    }

    public String get_vttlhold4() {
        return ttl4Lab.getText();
    }

    public String get_vttlhold5() {
        return ttl5Lab.getText();
    }

    public String get_vttlhold5l() {
        return ttl5lLab.getText();
    }

    public String get_vttlhold5r() {
        return ttl5rLab.getText();
    }

    public String get_vttlhold6() {
        return ttl6Lab.getText();
    }

    public String get_vttlholdb() {
        return ttlBLabel.getText();
    }

    public String get_vttlholdc() {
        return ttlCLabel.getText();
    }

    public String get_vttlholdm() {
        return ttlMLabel.getText();
    }

    void center() {
        holdNoLab.moveRight(100);
        hold1Lab.moveRight(100);
        hold2Lab.moveRight(100);
        hold3Lab.moveRight(100);
        hold4Lab.moveRight(100);
        hold5Lab.moveRight(100);
        hold5lLab.moveRight(100);
        hold5rLab.moveRight(100);
        hold6Lab.moveRight(100);
        totalLab.moveRight(100);

        baggageLab.moveRight(100);
        b1Text.moveRight(100);
        b2Text.moveRight(100);
        b3Text.moveRight(100);
        b4Text.moveRight(100);
        b5Text.moveRight(100);
        b5lText.moveRight(100);
        b5rText.moveRight(100);
        b6Text.moveRight(100);
        ttlBLabel.moveRight(100);

        cargoLab.moveRight(100);
        c1Text.moveRight(100);
        c2Text.moveRight(100);
        c3Text.moveRight(100);
        c4Text.moveRight(100);
        c5Text.moveRight(100);
        c5lText.moveRight(100);
        c5rText.moveRight(100);
        c6Text.moveRight(100);
        ttlCLabel.moveRight(100);

        mailLab.moveRight(100);
        m1Text.moveRight(100);
        m2Text.moveRight(100);
        m3Text.moveRight(100);
        m4Text.moveRight(100);
        m5Text.moveRight(100);
        m5lText.moveRight(100);
        m5rText.moveRight(100);
        m6Text.moveRight(100);
        ttlMLabel.moveRight(100);

        ttlLab.moveRight(100);
        ttl1Lab.moveRight(100);
        ttl2Lab.moveRight(100);
        ttl3Lab.moveRight(100);
        ttl4Lab.moveRight(100);
        ttl5Lab.moveRight(100);
        ttl5lLab.moveRight(105);
        ttl5rLab.moveRight(100);
        ttl6Lab.moveRight(100);
        maxLab.moveRight(100);
        max1Lab.moveRight(100);
        max2Lab.moveRight(100);
        max3Lab.moveRight(100);
        max4Lab.moveRight(100);
        max5Lab.moveRight(100);
        max5lLab.moveRight(93);
        max5rLab.moveRight(107);
        max6Lab.moveRight(100);
    }

    public void setFirstFieldActive() {
        Component[] list = getComponents();
        for (int i = 0; i < list.length; i++) {
            if (list[i] instanceof MyTextField) {
                if (list[i].isVisible() == true) {
                    list[i].requestFocusInWindow();
                    return;
                }

            }
        }
        //b1Text.requestFocusInWindow();
    }

    void hideMaximumLoadExceed() {
        maximumLoadExceedLab.setVisible(false);
    }

    void showMaximumLoadExceed() {
        maximumLoadExceedLab.setVisible(true);
    }

    public String roundDouble0(double value) {
        DecimalFormat fmt = new DecimalFormat();
        fmt.setMaximumFractionDigits(0);
        return fmt.format(value);
    }

    void set_vttlholdsw(double vttlholdsw) {
        totalDeadText.setText(roundDouble0(vttlholdsw));
    }

    @Override
    public boolean isValid() {
        try {
            if (maximumLoadExceedLab.isVisible()) {
                return false;
            } else {
                return true;
            }
        } catch (NullPointerException e) {
            return false;
        }
    }


    public void setOrderList() {
        Vector<Component> focusOrder = new Vector<Component>();
        try {
            Component[] components = this.getComponents();
            for (int i = 0; i < components.length; i++) {
                //System.out.print( components[i].getClass().toString()+"\t"+components[i].getName() +"\n");
                if (components[i].getClass().toString().equals("class samoloty.view.MyTextField")) {
                    if (components[i].isVisible()) {
                        focusOrder.add(components[i]);
                    }
                }
            }
        } catch (NullPointerException e) {
        }
        //
        travelsalPolicy = new MyOwnFocusTraversalPolicy(focusOrder);
        this.setFocusTraversalPolicy(travelsalPolicy);
        this.setFocusTraversalPolicyProvider(true);
        this.setFocusCycleRoot(true);
    }
}
